<template>
	<uni-popup ref="popup" :animation="true">
		<view class="alertbox">
			<image class="_titimg" v-if="prize.zs_img" :src="prize.zs_img" mode="widthFix"></image>
			<image class="prize_img" :src="prize.prize_img" mode="widthFix"></image>
			<view class="prize_name">{{prize.prize_name}}</view>
			<view class="prize_ts">{{prize.prize_ts}}～</view>

			<view class="btns">
				<button class="btn more" @click="_moreFun">再来一次</button>
				<button class="btn sure" style="margin: 68rpx auto 0;" @click="_closeFun">确认</button>
			</view>
		</view>
	</uni-popup>
</template>

<script>
	export default {
		data() {
			return {
				IMGLink: this.IMGLink,
				show: false,
				prize: {
					zs_img: "",
					prize_img: "http://beijingyuanjie.oss-cn-beijing.aliyuncs.com/groupbuy/activities/luckdraw/drawalert/fail.png",
					prize_name: "很遗憾您并未抽中奖品",
					prize_ts: "离大奖就差一点点啦~"
				},
				// 成功抽中
				// prize: {
				// 	zs_img: "http://beijingyuanjie.oss-cn-beijing.aliyuncs.com/groupbuy/activities/luckdraw/drawalert/titimg.png",
				// 	prize_img: "http://beijingyuanjie.oss-cn-beijing.aliyuncs.com/groupbuy/activities/luckdraw/drawalert/prize_coin.png",
				// 	prize_name: "300金币",
				// 	prize_ts: "奖励已发到你的账户"
				// }
			}
		},
		methods: {
			showFun(obj) {
				this.prize = obj
				this.$refs.popup.open()
			},
			_closeFun() {
				this.$refs.popup.close()
			},
			_moreFun() {
				this._closeFun()
				this.$emit("onemore")
			}
		}
	}
</script>

<style scoped>
	.drawalert {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .7);
		z-index: 1000;
	}

	.alertbox {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		background-color: white;
		border-radius: 44rpx;
		width: 578rpx;
		height: 592rpx;
	}

	._titimg {
		display: block;
		margin: 0 auto;
		width: 100%;
	}

	.prize_img {
		display: block;
		margin: 40rpx auto 0;
		width: 212rpx;
		height: auto;
	}

	.prize_name {
		margin: 18rpx auto 0;
		text-align: center;
		font-size: 38rpx;
		color: #232323;
		font-weight: 500;
	}

	.prize_ts {
		margin: 24rpx auto 0;
		text-align: center;
		color: #0a0c0d;
		font-size: 30rpx;
	}

	.btns {
		margin: 20rpx auto 0;
		width: 100%;
		height: 236rpx;
	}

	.btn {
		margin: 0 auto;
		width: 81%;
		height: 84rpx;
		line-height: 84rpx;
		text-align: center;
		font-size: 36rpx;
		color: white;
		border-radius: 42rpx;
		background: linear-gradient(360deg, #EE4629 0%, #EE653A 100%);
	}
</style>
